import sys

from ..download_news_dataset import batch_get_news_by_oss, generate_news_keyno_from_hive


def run():
    news_keynos_fp = sys.argv[1]
    output = sys.argv[2]
    try:
        index_counter_start = int(sys.argv[3])
    except IndexError:
        index_counter_start = None
    batch_get_news_by_oss(
        generate_news_keyno_from_hive(news_keynos_fp),
        output=output,
        concurrency_count=250,
        index_counter_start=index_counter_start)
